#! /bin/sh

name=binutils
from_source=binutils
revision=1
imagedeps="build-essential"
hostdeps="pkg-config"

configure() {
        CFLAGS="$HOST_CFLAGS" \
        CXXFLAGS="$HOST_CXXFLAGS" \
        LDFLAGS="$HOST_LDFLAGS" \
    "${source_dir}"/configure \
        --prefix="${prefix}" \
        --target=${OS_TRIPLET} \
        --with-sysroot="${sysroot_dir}" \
        --enable-separate-code \
        --enable-cet \
        --enable-default-execstack=no \
        --enable-deterministic-archives \
        --enable-gold \
        --enable-ld=default \
        --enable-new-dtags \
        --enable-plugins \
        --enable-relro \
        --enable-threads \
        --disable-nls \
        --disable-werror \
        --with-pic
}

build() {
    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

        strip_command=strip \
    post_package_strip
}
